home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / edfile.dqc / EDFILE.DOC
Encoding:
Text File  |  1985-09-13  |  19.3 KB  |  422 lines

  1.  
  2.               EDFILE UTILITY USAGE
  3.               Jan 10, 1984
  4.  
  5. by Mike Mosko, K3RL
  6.  
  7. EDFILE    is  a  public  domain utility which  allows  display  and
  8. editing of data in files.  It has been tested and run under CP/M-
  9. 80 version 2.2    and TurboDOS 1.2  and should  run in any  CP/M-80
  10. type environment.
  11.  
  12. EDFILE    is  approximately  11k    in size.  EDFILE  may  be  freely
  13. distributed  to whomever desires it.  The date of  this  document
  14. should    agree  with  the version date in  EDFILE.
  15.  
  16. FEATURES:
  17. ========
  18.  
  19.      - Hex and ASCII display of record data.
  20.      - Screen editing of selected record.
  21.      - Hex or ASCII input when editing file records.
  22.      - Fully programmable cursor control.
  23.      - Powerful file search capabilities.
  24.      - Forward and backward record scrolling.
  25.      - Address and/or record number referencing.
  26.      - Decimal or Hex number inputs.
  27.      - Disk reset on input (prevents Disk R/O error).
  28.      - Full online abbreviated help AND expanded help menus.
  29.  
  30.  
  31. INSTALLATION:
  32. ============
  33.  
  34. The  following    information  will aid the  user  when  installing
  35. EDFILE    on a different terminal.
  36.  
  37. The EDFILE original distribution program is originally configured
  38. for  an  ADM-3A  type  terminal or equivalent (I  use  a  Digilog
  39. S1500).  The  terminal must be able to display 80 columns  by  24
  40. rows.  The only absolutely necessary function required for proper
  41. use   is  the  cursor  positioning  function.    Other    functions
  42. that  can be added merely for visual purposes are the cursor  on,
  43. cursor    off and clear to end-of-line functions.  If the clear  to
  44. end-of-line  function is not preprogrammed,  it is  performed  in
  45. software.  These  functions  are not implemented in the  original
  46. distribution version of EDFILE.  For ADM-3A type  terminals,  the
  47. following  commands can be patched in EDFILE if these  attributes
  48. are desired:
  49.  
  50.      Clear to end-of-line .... ESC 'Q' (1B,51)
  51.      Enable Cursor ........... ESC 'X' (1B,58)
  52.      Disable Cursor .......... ESC 'Y' (1B,59)
  53.  
  54. For example, to add the clear to end-of-line function, patch a 02
  55. for  the string length (2 bytes for the sequence) at address 146.
  56. Then patch a 1B in location 147 and a 51 in location 148.
  57.  
  58. Certain  functions  are programmable for the type of terminal  in
  59. use.  Five bytes are reserved for each terminal function  (string
  60. sequence).  The  first    byte represents the length of the  string
  61. sequence.  For example: the initial cursor positioning string for
  62. an  ADM-3A  terminal is 'ESC ='.  This is two  bytes  in  length.
  63. Therefore,  the  values  inserted  into  the  cursor  positioning
  64. sequence  area    are (in hex):  02,1B,3D.  To complete the  cursor
  65. positioning sequence for the terminal, the row and column must be
  66. issued    as  well.  The ADM-3A requires an  adjustment  value  (or
  67. offset)  of  32 decimal (20 hex) be added to the row and  column.
  68. For terminals that require a different offset,    this value can be
  69. changed  as  well.
  70.  
  71. The row is usually sent before the column,  but if your  terminal
  72. is different, i.e., the column must be issued first, then set the
  73. high order bit of the cursor offset value.  This flags the cursor
  74. positioning  routine  to  send the column before  the  row.   The
  75. following  addresses  detail  the  location  of  the   modifiable
  76. parameters for the terminal.
  77.  
  78. Address   Default (hex)    Function
  79. -------   -------------    --------
  80. 140      02,1B,3D,00,00  *Initial cursor positioning string sequence
  81. 145      20          *Row/column adjustment (set high bit for
  82.                column/row)
  83. 146      00,00,00,00,00   Clear to end-of-line string sequence
  84. 14B      00,00,00,00,00   Enable cursor (cursor on) string sequence
  85. 150      00,00,00,00,00   Disable cursor (cursor off) string sequence
  86. 155      08           Cursor left (normally CTRL-H)
  87. 156      0C           Cursor right (normally CTRL-L)
  88. 157      0B           Cursor up (normally CTRL-K)
  89. 158      0A           Cursor down (normally CTRL-J)
  90. 159      00..........00   Terminal initialization string (35 bytes)
  91.  
  92. * - Must be implemented.
  93.  
  94. If  your  terminal requires some sort of  initialization  string,
  95. either to preset it or to program a function key pad, this can be
  96. inserted  into the terminal initialization string area    provided.
  97. The  first byte represents the length of the string to be  issued
  98. to   the  terminal.   There  are  35  bytes  available     for   an
  99. initialization string.    Why so many? The Digilog S1500 computer I
  100. use allows reprogramming of the numeric keypad.  This requires 28
  101. bytes.
  102.  
  103. The  actual  control  sequences for positioning the  cursor  (up,
  104. down,  left  and  right) can be changed.  This    is  provided  for
  105. terminals  that have cursor positioning keypads which don't issue
  106. the  same ones programmed here.  For example:  usually    a  CTRL-L
  107. moves the cursor one space to the right.  However, if your cursor
  108. pad issues some other control character,  like a CTRL-D (WordStar
  109. type),    then patch a 04 (hex equivalent of CTRL-D) for the cursor
  110. right value.  Note, the help menus will still display the default
  111. values for up, down, left and right cursor movements. You'll have
  112. to make a note about this or, better yet, use EDFILE to patch the
  113. help menus.
  114.  
  115. All of the above modifications (patches) can be made easily  with
  116. EDFILE itself.    Of course, if it won't run at all, you'll have to
  117. resort    to  some sort of debugger  such  as  DDT,  SID,  MONITOR,
  118. etc...,  or  better  yet,  use    someone  elses    computer  with    a
  119. (working) version of EDFILE to modify it for your terminal.
  120.  
  121. EDFILE    should work on virtually all terminals currently in  use.
  122. There  may be some real strange ones out there that I don't  know
  123. about, but that's life.
  124.  
  125.  
  126. OPERATION:
  127. =========
  128. EDFILE    is simple to use especially with the online  help  menus.
  129. Therefore, just a few tidbits of information is provided here for
  130. operation.  To invoke EDFILE,  simply type EDFILE followed by the
  131. name of the file you wish to dump and/or edit.    Example:
  132.  
  133.       EDFILE EDFILE.COM
  134.  
  135. The display should look similar to the following:
  136.  
  137. -----------------------------------------------------------------
  138. Vers: 01-10-84; by: J.C.Kaltwasser & M.J.Mosko, K3RL
  139.  
  140. File: EDFILE.COM  Record: 00000 (0000H)   LOF: 00086 (0056H)
  141.     00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F    0123456789ABCDEF
  142.     -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --    ----------------
  143. 0100  - 31 EA 01 C3 EA 01 0D 0A 56 65 72 73 3A 20 30 31    >1j.Cj...Vers: 01<
  144. 0110  - 2D 31 30 2D 38 34 3B 20 62 79 3A 20 4A 2E 43 2E    >-10-84; by: J.C.<
  145. 0120  - 4B 61 6C 74 77 61 73 73 65 72 20 26 20 4D 2E 4A    >Kaltwasser & M.J<
  146. 0130  - 2E 4D 6F 73 6B 6F 2C 20 4B 33 52 4C 0D 0A 24 1A    >.Mosko, K3RL..$.<
  147. 0140  - 02 1B 3D 00 00 20 00 00 00 00 00 00 00 00 00 00    >..=.............<
  148. 0150  - 00 00 00 00 00 08 0C 0B 0A 00 00 00 00 00 00 00    >................<
  149. 0160  - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    >................<
  150. 0170  - 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    >................<
  151.  
  152. -----------------------------------------------------------------
  153.  
  154. EDFILE    performs  an  automatic disk reset  (^C)  when    executed.
  155. Therefore,  don't  panic  if you suddenly realized you forgot  to
  156. perform a Control-C after making some changes.    This prevents the
  157. infamous (and frustrating) Bdos Err on A:  R/O from occuring when
  158. writing records.
  159.  
  160. The  LOF  means the Length-Of-File which is the total  number  of
  161. records  in  the  file.  Record  numbers begin    at  0;    the  last
  162. displayable record number is actually the LOF - 1.
  163.  
  164. If  you don't specify a file on the command line,  you'll get  an
  165. error:    "No File Specified."; or if the file is not found, you'll
  166. get an error telling you this: "<filename> Not Found." Simple.
  167.  
  168. At the ? prompt, type 'H'. The brief help menu will be displayed:
  169.  
  170. -----------------------------------------------------------------
  171. Read/Edit File Utility Functions:
  172. A - Address to dump      B - Dump at beginning     C - Continue Search
  173. E - Enter Edit Mode      H - This help list        M - Expanded Help list
  174. O - Set address offset      Q - Quit this program     R - Read & dump record
  175. S - Search for string      Z - Dump at end of file   CR - (+/=) - Adv record
  176. (-/_) - Decr record
  177.  
  178. Edit Mode Functions:
  179. ^E - Toggle data fields   ^W - Write buffer out     ^X - Abort Edit Mode
  180. ^J - Cursor Down      ^K - Cursor Up        ^H - Cursor Left
  181. ^L - Cursor Right
  182. -----------------------------------------------------------------
  183.  
  184. Again at the ? prompt, type 'M'. This will display the expanded help menu.
  185.  
  186. -----------------------------------------------------------------
  187. Read/Edit File Utility Functions:
  188.     A - Enter relative address to dump
  189.     B - Set record to beginning of file and dump data
  190.     C - Continue search. Restarts search on last entered search string.
  191.     E - Enter Edit mode on current record
  192.     H - Brief description of the functions
  193.     M - This help description
  194.     O - Enter offset address relative to start of file (.COM = 100h)
  195.     Q - Quit program
  196.     R - Enter record number to dump
  197.     S - Search for hex or ASCII string in file (starts at current record)
  198.         '\' = ASCII string delimiters (ex: \Test\)
  199.         ',' = hex and/or ASCII delimiters (ex: 41,\Test\,4A
  200.         ';' = select search options
  201.             A - Start search from beginning of file
  202.             B - Search Backwards
  203.             M - Search on certain bits set; use mask xx
  204.             O - Stop on xx occurrence of string
  205.             U - Translate lower case characters to upper case
  206.             Z - Search recognition on least significant 7 bits only
  207.  
  208.     Z - Set record to end of file and dump data
  209.     CR - carriage return (or +/= key) - advances record and dumps the data
  210.     -/_ key - decrements record and dumps the data
  211.  
  212. Edit mode: ('^' refers to the Control key)
  213.  
  214.     ^[ - (ESC) Accept next char into edit field even if a control char
  215.     ^E - Toggle between ASCII and hex data fields
  216.     ^W - Flush record to disk
  217.     ^X - Abort edit mode without updating record
  218.  
  219.     ^J - Cursor down        ^K - Cursor up
  220.     ^H - Cursor left        ^L - Cursor right
  221.  
  222. Input integers are decimal. Use 'h' suffix for hexadecimal entries.
  223. -----------------------------------------------------------------
  224.  
  225. Use  the '=' key (which has the '+') or the RETURN key to advance
  226. the record. You don't have to use the shift key with the '=' key.
  227. EDFILE will wrap around to the start of the file when  attempting
  228. to advance beyond the end of the file.
  229.  
  230. The  following    paragraphs  expand on the features  available  in
  231. EDFILE.  Most  of the options are self-explanatory from the  help
  232. menus.    However,  some    require additional explanations  and  are
  233. provided below.
  234.  
  235. ADDRESS/OFFSET OPTIONS
  236. ----------------------
  237. The  address option allows you to specify an address  within  the
  238. file. This is useful for patching COM files and the like when the
  239. address  of  the patch is known.  Note that when  EDFILE'ing  COM
  240. files,    EDFILE automatically sets the offset to 0100h. The offset
  241. can  be  changed by typing 'O' at the command level and  entering
  242. the  desired  offset.  The  headings  will be  adjusted  for  the
  243. different   offset  automatically.   The  address  option  always
  244. references  the starting offset so that locations within programs
  245. which don't begin at 0100h (overlays,  for example) can be easily
  246. referenced  once  the offset has been  properly  programmed.  The
  247. Address option also has a wrap-around feature so that  references
  248. below the current offset will be readjusted.  This feature can be
  249. quite  handy  when tinkering around with COM files.  You have  to
  250. experiment a little to pickup the usefulness of these options.
  251.  
  252. SEARCH OPTION
  253. -------------
  254. The  'search'  option is the most involved because it  offers  so
  255. many different possibilites. The description provided here should
  256. provide enough information to effectively use it.
  257.  
  258. String    searches  normally  start  from the  current  record  and
  259. proceed  until the end of the file (EOF) is encountered.  Certain
  260. suboptions can alter this sequence.  If a match is not found, the
  261. program  will indicate this and restore the screen to the  record
  262. last  displayed.  The search can be aborted at any time by simply
  263. striking a key.
  264.  
  265. If a string match occurs across records,  the search will stop on
  266. the  last  record  read into its' local buffer and  position  the
  267. cursor    at  the end of the found string.  It  just  wasn't  worth
  268. putting in the extra code to handle this wierd situation.
  269.  
  270. When  using the Occurrence ('O') and Mask ('M')  suboptions,  the
  271. program will prompt for the occurrence number and/or search  mask
  272. to  be    used.  The suboptions are inserted after a  semicolon  to
  273. delimit them from the search string entered.  No spaces should be
  274. inserted   between  the  suboptions.   Upper  or  lower  case  is
  275. acceptable. Example:
  276.  
  277.      ?Search String = \This is great\;auo
  278.      Stop on string occurrence = 3
  279.  
  280.   This    means to search for the string 'This is  great'  starting
  281.   from      the  beginning of the file,  ignoring the case  of  the
  282.   string  (i.e.,  translate lower to upper case) and stopping  on
  283.   the third occurrence of the string.
  284.  
  285. ASCII  strings    must  be delimitted  by  backslashes  ('\').  The
  286. limitation  here,  of  course,    is  that  you  can't  search  for
  287. backslashes in the file.  So use the hex equivalent if necessary:
  288. 5C.
  289.  
  290. The  'U'  suboption  (translate lower case to  upper  case)  will
  291. translate the search string to upper case automatically,  as well
  292. as  converting all lower case characters read from the file.  So,
  293. you  don't  have to input the search string in    upper  case  when
  294. using the 'U' suboption.
  295.  
  296. When  inputting hexidecimal values as part of a search key,  they
  297. MUST be two-digit HEX (not decimal) numbers. An invalid hex digit
  298. entry will cause an error and the string entry must be reentered.
  299. Two  digits  must be supplied for each hex number  otherwise  the
  300. search    won't  work  properly.     Upper    or  lower  case  for  the
  301. hexidecimal letters is acceptable. Example:
  302.  
  303.      ?Search String = 40,FE,e5,05
  304.  
  305. You  can  mix hex entries with string entries within  the  search
  306. key. Example:
  307.  
  308.      ?Search String = 40,FE,\help me\,E5,05
  309.  
  310. The  Backward search suboption (B) will start the search from the
  311. current  record and continue towards the start of  the    file.  It
  312. DOES  NOT reverse the search string key,  that is,  if you  enter
  313. \HELP\ for a search string key,  it will not search backwards for
  314. \PLEH\.  It only refers to the direction the records will be read
  315. while  searching  for a matching string.  Also,  each  record  is
  316. searched from the start of the record.    The search stops when the
  317. start of the file (SOF) is encountered.
  318.  
  319. The  Mask suboption is for those cases where bytes in a file  use
  320. certain  bits for special meanings.  The input mask is    logically
  321. AND'd  with  each  byte in the file before comparing  it  to  the
  322. search string.    Therefore,  some bytes could pass the search test
  323. but still may not be exactly what your looking for.
  324.  
  325.      ?Search String = 03;M
  326.      Enter string search mask = 0Fh
  327.  
  328.   This    will  mask all upper nibbles (upper 4 bits of each  byte)
  329.   and  then compare it to a 3.    Therefore,  any data bytes  which
  330.   have a 3 in the lower nibble will cause a match with the search
  331.   key.
  332.  
  333. When  the  search  string is found in the  file,  the  search  is
  334. temporarily  terminated and the cursor is positioned at the start
  335. of the found string.  Note,  that the program is NOT in the  edit
  336. mode,  so  the next key entered is a command not an edit  control
  337. key.  Hit  a space (or any unrecognizable command) to redump  the
  338. record and place the cursor on the command line. Hit an 'E' to go
  339. into  the  edit mode.  The cursor will remain positioned  at  the
  340. start of the found string.
  341.  
  342. CONTINUE SEARCH OPTION
  343. ----------------------
  344. Hitting  a 'C' at the command level will restart the search  from
  345. the  current record and cursor position (if previously    defined).
  346. The search facility will then look for the NEXT occurrence of the
  347. entered  string sequence.  The 'O' suboption is affective only on
  348. the  initial  start  of the search.  The  Continue  ('C')  option
  349. effectively disables the occurrence value previously entered. The
  350. default  string  occurrence  is 1,  i.e.,  the    first  (or  next)
  351. occurrence.  The Continue option can be invoked at any time after
  352. a search string key has been entered. All other suboptions are in
  353. affect when continuing the search.
  354.  
  355.  
  356. RECORD EDITING
  357. --------------
  358. Record    editing is accomplished by typing an 'E' at  the  command
  359. level. When in the edit mode, there are two modes of editing. You
  360. can  edit  the HEXIDECIMAL field area of the record or the  ASCII
  361. field  area.  When  entering  the edit mode the  cursor  will  be
  362. positioned at the upper left corner in the HEX data field of  the
  363. current record.  To switch to the ASCII data field of the record,
  364. simply    enter a CTRL-E.  This will toggle the cursor between  the
  365. two  fields.  The  HEX field area will    only  accept  hexidecimal
  366. digits    for  inputs.  The ASCII field will accept all key  inputs
  367. including control key inputs if they are preceeded by an ESC key.
  368. For  example:  to input a CTRL-K into the record at  the  current
  369. cursor position,  hit the ESC key followed by a CTRL-K.  The  ESC
  370. key  simply  means 'put the next input character into the  record
  371. even if its' a control character'.  This is only affective in the
  372. ASCII  field area.  Non-control characters (i.e.,  regular ASCII)
  373. can be typed in directly.
  374.  
  375. To make the record changes permanently to the file,  they must be
  376. flushed to the disk by typing a CTRL-W. Typing a CTRL-X will exit
  377. the edit mode without updating the file.
  378.  
  379. BUGS:
  380. ====
  381. There  are  currenly  no  know    bugs.  However,  inputs  are  not
  382. completely  validated,    therefore,  some conditions  could  cause
  383. different results.  None, however, are know to cause file crashes
  384. or  anything catastrophic.  Any reports of bugs will be noted and
  385. appreciated.
  386.  
  387. USE UNDER TURBODOS:
  388. ==================
  389. EDFILE    is especially useful under TurboDOS.  Using the  filename
  390. $.DSK  or  $.DIR upon entering EDFILE allows editing of the  disk
  391. and/or directory.  I use EDFILE in every case when I need to look
  392. at the disk directory and make changes to it. The search facility
  393. makes this task a breeze.
  394.  
  395. BACKGROUND INFO:
  396. ===============
  397. EDFILE     was   written    in  a  language   called   SIL     (Systems
  398. Implementation    Language)  which was obtained from DDJ    and  then
  399. enhanced and improved at Digilog,  Inc for use in writing systems
  400. programs  and  utilities.  SIL is very similar to 'C' but  allows
  401. true  inline 8080/Z80 assembly language coding (very useful)  and
  402. compiles to actual assembly mnemonics. The output of the compiler
  403. is  passed to Digital Research Inc's Relocatable Assembler (RMAC)
  404. and then to DRI's Linker (LINK).  No special tricks were used  in
  405. this program; that is, no system specific calls or locations were
  406. referenced,  therefore,  it should run on any CP/M or  equivalent
  407. system.  Of course,  Murphy is lurking around, so don't depend on
  408. that assumption.
  409.  
  410. FUTURE VERSIONS:
  411. ===============
  412. On  the wish list is to add the capability to read and    edit  the
  413. data  off of the disk on a track/sector basis.     Any other  ideas
  414. will be seriously considered in future versions of EDFILE.
  415. Thanks and good EDFILE'ing.
  416.  
  417. Problems,  suggestions    or  questions  can be sent to  me  on  my
  418. CompuServe number (#72345,1540) or via my home address:
  419.      Mike Mosko
  420.      519 E. Station Ave.
  421.      Coopersburg, PA 18036
  422.